package com.unitTest;

import static org.junit.Assert.*;

import org.jmock.Expectations;
import org.jmock.Mockery;
import org.junit.Test;

import com.acmetelecom.BillGenerator;
import com.acmetelecom.LineItem;
import com.acmetelecom.Printer;

import com.acmetelecom.customer.Customer;

import java.util.ArrayList;
import java.util.List;

public class BillGeneratorTest {
	
	Mockery context = new Mockery();
	
	@Test
	public void testBillGenerator() {
		final Printer printer = context.mock(Printer.class);
		Customer customer = new Customer("zjk", "88888888", "Business");
		List<LineItem> calls = new ArrayList<LineItem>();
		calls.add(new callStart(""));
		String totalBill = "1000";
		BillGenerator bg = new BillGenerator(printer);
		context.checking(new Expectations(){{
			oneOf(printer.printHeading("zjk", "88888888","Business"));
			oneOf(printer.printItem(time, callee, duration, cost);
			
		}});
		bg.send(customer, calls, totalBill);
	}
}
